package com.blog.backend.manage;

import com.blog.backend.domain.BlogInfo;
import com.blog.common.core.domain.R;
import org.springframework.stereotype.Service;

/**
 * @Author:Auman Time：2024/5/10 11:01
 */

@Service
public class BlogCheck {

    public R blogCheck(BlogInfo info){

        if(info.getTitle() == null || info.getTitle().equals("")){
            return R.fail("博客标题不能为空");
        }
        if(info.getContent() == null || info.getContent().equals("")){
            return R.fail("博客内容不能为空");
        }
        if(info.getAuthor() == null || info.getAuthor().equals("")){
            return R.fail("博客作者不能为空");
        }
        if(info.getCategory() == null || info.getCategory().length == 0){
            return R.fail("博客分类不能为空");
        }
        return R.ok();

    }

    public R uploadCheck() {


        return R.ok();
    }

}
